package com.nikmesoft.android.ebox.activities;

import com.nikmesoft.android.ebox.R;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;



public class SettingsActivity extends BaseActivity implements OnClickListener {
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_settings);
		//tvFeedback.setOnClickListener(this);
		//tvAboutus.setOnClickListener(this);
		//tvGiveus.setOnClickListener(this);
	}

	public void onClick(View v) {
		if(v.getId()==R.id.feedback){
			try {
			Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
			String[] recipients = new String[] {"anhtuan442@gmail.com"};
			emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, recipients);
			emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Feedback mail..");
			emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,"This is email's message");
			emailIntent.setType("text/plain");
			startActivity(Intent.createChooser(emailIntent, "Send mail..."));
			}
			catch (Exception e){
				
			}
			 
		}
		else if(v.getId()==R.id.givestar){
			try {
			Uri uriUrl = Uri.parse("https://play.google.com"); 
			Intent intent = new Intent(Intent.ACTION_VIEW,uriUrl);
			startActivity(intent);
			}
			catch (Exception e){
				
			}
			
		}
		else if(v.getId()==R.id.about){
			Activity4 parent = (Activity4) getParent();
			Intent intent = new Intent(parent, AboutUsActivity.class);
			//intent.putExtra(ExtraBinding.OS, adapter.getItem(position));
			parent.startChildActivity(AboutUsActivity.class.getSimpleName(),intent);
		}
				
			
}
	
	@Override
	public void onBackPressed() {
		// TODO Auto-generated method stub
		super.onBackPressed();
		Intent intent = new Intent(SettingsActivity.this,
			PhotosActivity.class);
		startActivity(intent);
	}

}